<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/1
 * Time: 22:03
 */

namespace Lib\Api;


class RoleSysMenuApi extends UtilsApi {
    private static $modelName = 'RoleSysMenu';

    /** 获取角色菜单列表
     * @param $where
     * @param int $page_num
     * @param int $page_size
     * @param string $filed
     * @return mixed
     */
    public static function getList($where, $page_num = 15, $page_size = 1, $filed = "*") {
        $list = parent::getList(RoleSysMenuApi::$modelName, $where, $page_num, $page_size, $filed);
        return $list;
    }

    /** 获取角色菜单总数
     * @param $where
     * @return mixed
     */
    public static function getTotal($where) {
        $total = parent::getTotal(RoleSysMenuApi::$modelName, $where);
        return $total;
    }

    /** 获取角色菜单信息
     * @param $where
     * @param $filed
     * @return mixed
     */
    public static function getInfo($where, $filed= "*") {
        $manager = parent::getInfo(RoleSysMenuApi::$modelName, $where, $filed);
        return $manager;
    }

    /** 添加角色菜单
     * @param $data
     * @return mixed
     */
    public static function add($data) {
        $id = parent::add(RoleSysMenuApi::$modelName, $data);
        return $id;
    }

    /** 修改角色菜单
     * @param $data
     * @return bool
     */
    public static function save($data) {
        $state = parent::save(RoleSysMenuApi::$modelName, $data);
        return $state;
    }

    /** 删除角色菜单
     * @param $where
     */
    public static function delete($where) {
        parent::delete(RoleSysMenuApi::$modelName, $where);
    }
}